package cn.gcyl.module.biz.dal.mysql.alliancemembers;

import java.util.*;

import cn.gcyl.framework.common.pojo.PageResult;
import cn.gcyl.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.gcyl.framework.mybatis.core.mapper.BaseMapperX;
import cn.gcyl.module.biz.dal.dataobject.alliancemembers.AllianceMembersDO;
import org.apache.ibatis.annotations.Mapper;
import cn.gcyl.module.biz.controller.admin.alliancemembers.vo.*;

/**
 * 联盟成员链接 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AllianceMembersMapper extends BaseMapperX<AllianceMembersDO> {

    default PageResult<AllianceMembersDO> selectPage(AllianceMembersPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AllianceMembersDO>()
                .likeIfPresent(AllianceMembersDO::getCorporateName, reqVO.getCorporateName())
                .eqIfPresent(AllianceMembersDO::getSort, reqVO.getSort())
                .inIfPresent(AllianceMembersDO::getVisitors, reqVO.getVisitors())
                .eqIfPresent(AllianceMembersDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(AllianceMembersDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AllianceMembersDO::getId));
    }

}